<template>
	<view class="data-item">
		<view class="order-type">
			<view>专项检查: <text>{{value.apply_no}}</text></view>
			<!-- <view class="type red">待接单</view> -->
			<!-- <view class="type blue">已报修</view>
			<view class="type yellow">巡查异常</view> -->
		</view>
		<view class="order-info">
			<view class="info-item"><view class="key">计划名称：</view>{{value.pm_sinspection.plan_name}}</view>
			<view class="info-item"><view class="key">检查内容：</view>{{value.pm_sinspection.sinspection_content}}</view>
			<view class="info-item"><view class="key">检查日期：</view>{{value.pm_sinspection.inspect_date}}</view>
			<view class="info-item"><view class="key">检查负责人：</view>{{value.pm_sinspection.inspect_user_name}}</view>
		</view>

		<view v-if="value.pm_sinspection.status === '20'" class="handle-btn">
			<view @click="done" v-if="$util.getRights().pm_sinspection_register">立即处理</view>
			<view v-else @click="viewDetail">查看详情</view>
		</view>
		<view v-else-if="value.pm_sinspection.status === '30'" class="handle-btn">
			<view @click="fix" v-if="$util.getRights().pm_sinspection_rectify">整改处理</view>
			<view v-else @click="viewDetail">查看详情</view>
		</view>
		<!-- <view v-else-if="value.pm_sinspection.status === '40'" class="handle-btn">
			<view @click="check" v-if="$util.getRights().pm_sinspection_check">抽查</view>
			<view v-else @click="viewDetail">查看详情</view>
		</view> -->
		<view v-else-if="value.pm_sinspection.status === '40'" class="handle-btn">
			<view @click="done" v-if="$util.getRights().pm_sinspection_register">立即处理</view>
			<view v-else @click="viewDetail">查看详情</view>
		</view>
		<view v-else class="handle-btn">
			<view @click="viewDetail">查看详情</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'SpecialTask',
	props:{
		value: {
			type: Object,
			default: ()=>{
				return {}
			}
		}
	},
	data(){
		return {
		}
	},
	created(){
	},
	methods:{
		viewDetail(item){
			console.warn("item: ", item)
			uni.navigateTo({
				url: '/pagesA/special-check/special-check-detail?spectionId=' + this.value.pm_sinspection.spection_id  //?isInList=true&data='+JSON.stringify(item) + "&eventName=" + eventName
			})
		},
		// acceptTask(){
		// 	uni.navigateTo({
		// 		url: '/pages/special-check/special-check-accept?spectionId=' + this.value.pm_sinspection.spection_id//'/?repairId=' + this.value.pm_sinspection.repair_id //isInList=true&data='+JSON.stringify(this.value)
		// 	})
		// },
		done() {
			uni.navigateTo({
				url: '/pagesA/special-check/special-check-done?spectionId=' + this.value.pm_sinspection.spection_id //isInList=true&data='+JSON.stringify(this.value)
			})
		},
		fix() {
			uni.navigateTo({
				url: '/pagesA/special-check/special-check-fix?spectionId=' + this.value.pm_sinspection.spection_id //isInList=true&data='+JSON.stringify(this.value)
			})
		},
	}
}
</script>

<style lang="scss" scoped>
@import './style.scss';

.type{
	font-size: 24rpx;
	font-weight: bolder;
	padding: 12rpx;
	border-radius: 4rpx;
}
.red{
	color: #FF3737;
	background-color: #FFEFEF;
}
.yellow{
	color: #FF972C;
	background-color: #FFF8EF;
}
.blue{
	color: #2C72FF;
	background-color: rgba($color: #A5C2FF, $alpha: .16);
}
</style>
